// 请求响应类型
export interface Response<T = any> {
  code: number;
  data: T;
  message: string;
}

// 分页请求参数
export interface PageParams {
  page: number;
  pageSize: number;
}

// 分页响应数据
export interface PageResult<T> {
  list: T[];
  total: number;
  page: number;
  pageSize: number;
}

// 列表响应数据
export type ListResult<T> = T[];

// 通用键值对类型
export interface Dictionary<T = any> {
  [key: string]: T;
}

// 基础用户信息
// 优惠券类型定义
export interface Coupon {
  id: string | number;
  name: string;
  type: 'discount' | 'cash';
  code?: string;
  threshold?: number;
  discount?: number;
  amount?: number;
  minAmount?: number;
  scope: string;
  categoryId?: string | number;
  startTime: string;
  endTime: string;
  validTimeDesc?: string;
  status: 'unused' | 'used' | 'expired';
  description?: string;
  received?: number;
  limit?: number;
}

// 基础用户信息
export interface UserInfo {
  id: string | number;
  username: string;
  nickname?: string;
  avatar?: string;
  coupons?: Coupon[];
  [key: string]: any;
}